//
//  RBTopicCell.m
//  Budejie
//
//  Created by 华杨科技 on 2017/11/27.
//  Copyright © 2017年 饶波. All rights reserved.
//

#import "RBTopicCell.h"
#import <UIImageView+WebCache.h>
#import "RBTopics.h"

@interface RBTopicCell ()
@property (weak, nonatomic) IBOutlet UIImageView *profileImageView; // 头像
@property (weak, nonatomic) IBOutlet UILabel *nameLabel; // 姓名
@property (weak, nonatomic) IBOutlet UILabel *createtimeLb; // 帖子创建时间
@property (weak, nonatomic) IBOutlet UILabel *textLb; // 帖子内容
@property (weak, nonatomic) IBOutlet UILabel *hotCommentLb; // 最热评论
@property (weak, nonatomic) IBOutlet UIButton *dingBtn; // 顶按钮
@property (weak, nonatomic) IBOutlet UIButton *caiBtn; // 踩按钮
@property (weak, nonatomic) IBOutlet UIButton *fenxiangBtn; // 分享按钮
@property (weak, nonatomic) IBOutlet UIButton *commentBtn; // 评论按钮

// 最热评论，暂时隐藏。
@property (weak, nonatomic) IBOutlet UIView *hotCommentView;

@end

@implementation RBTopicCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.profileImageView.layer.cornerRadius = 20;
    self.profileImageView.layer.masksToBounds = YES;
    
    self.hotCommentView.hidden = YES; // 暂时隐藏。
}


- (void)setTopics:(RBTopics *)topics
{
    _topics = topics; // 先给带下划线的实例变量赋值
    
    [self.profileImageView sd_setImageWithURL:[NSURL URLWithString:_topics.profile_image]];
    self.nameLabel.text = topics.name;
    self.createtimeLb.text = topics.created_at;
    self.textLb.text = topics.text;
}

@end
